using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace Easislides
{
	public class FrmMove : Form
	{
		private IContainer components = null;
		private Button BtnCancel;
		private Button BtnOK;
		private ListView SongFolder;
		private Label Label1;
		private ColumnHeader columnHeader1;
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
            this.BtnCancel = new System.Windows.Forms.Button();
            this.BtnOK = new System.Windows.Forms.Button();
            this.SongFolder = new System.Windows.Forms.ListView();
            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
            this.Label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // BtnCancel
            // 
            this.BtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.BtnCancel.Location = new System.Drawing.Point(154, 179);
            this.BtnCancel.Name = "BtnCancel";
            this.BtnCancel.Size = new System.Drawing.Size(80, 24);
            this.BtnCancel.TabIndex = 2;
            this.BtnCancel.Text = "Cancel";
            this.BtnCancel.Click += new System.EventHandler(this.BtnCancel_Click);
            // 
            // BtnOK
            // 
            this.BtnOK.Location = new System.Drawing.Point(58, 179);
            this.BtnOK.Name = "BtnOK";
            this.BtnOK.Size = new System.Drawing.Size(80, 24);
            this.BtnOK.TabIndex = 1;
            this.BtnOK.Text = "OK";
            this.BtnOK.Click += new System.EventHandler(this.BtnOK_Click);
            // 
            // SongFolder
            // 
            this.SongFolder.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.columnHeader1});
            this.SongFolder.FullRowSelect = true;
            this.SongFolder.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
            this.SongFolder.Location = new System.Drawing.Point(12, 46);
            this.SongFolder.MultiSelect = false;
            this.SongFolder.Name = "SongFolder";
            this.SongFolder.Size = new System.Drawing.Size(277, 121);
            this.SongFolder.TabIndex = 0;
            this.SongFolder.UseCompatibleStateImageBehavior = false;
            this.SongFolder.View = System.Windows.Forms.View.Details;
            this.SongFolder.DoubleClick += new System.EventHandler(this.SongFolder_DoubleClick);
            // 
            // columnHeader1
            // 
            this.columnHeader1.Width = 240;
            // 
            // Label1
            // 
            this.Label1.Location = new System.Drawing.Point(13, 9);
            this.Label1.Name = "Label1";
            this.Label1.Size = new System.Drawing.Size(276, 34);
            this.Label1.TabIndex = 3;
            this.Label1.Text = "label1";
            // 
            // FrmMove
            // 
            this.AcceptButton = this.BtnOK;
            this.CancelButton = this.BtnCancel;
            this.ClientSize = new System.Drawing.Size(301, 215);
            this.Controls.Add(this.Label1);
            this.Controls.Add(this.SongFolder);
            this.Controls.Add(this.BtnCancel);
            this.Controls.Add(this.BtnOK);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "FrmMove";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Move item(s) to another folder";
            this.Load += new System.EventHandler(this.FrmMove_Load);
            this.ResumeLayout(false);

		}
		public FrmMove()
		{
			this.InitializeComponent();
		}
		private void FrmMove_Load(object sender, EventArgs e)
		{
			this.Label1.Text = string.Concat(new object[]
			{
				"You have selected ",
				gf.SelectedItemsCount,
				" item",
				(gf.SelectedItemsCount > 1) ? "s" : "",
				" for Moving. Please choose a folder to move the item",
				(gf.SelectedItemsCount > 1) ? "s" : "",
				" to, and then click OK."
			});
			gf.MoveToFolder = -1;
			this.SongFolder.Items.Clear();
			for (int i = 1; i <= 40; i++)
			{
				if (gf.FolderUse[i] > 0)
				{
					this.SongFolder.Items.Add(gf.FolderName[i]);
				}
			}
		}
		private void BtnOK_Click(object sender, EventArgs e)
		{
			if (this.SongFolder.Items.Count > 0)
			{
				if (this.SongFolder.SelectedItems.Count > 0)
				{
					gf.MoveToFolder = gf.GetFolderNumber(this.SongFolder.SelectedItems[0].Text);
					base.DialogResult = DialogResult.OK;
					base.Close();
				}
				else
				{
					MessageBox.Show("Please select a folder to move the songs to!");
				}
			}
			else
			{
				MessageBox.Show("There are no Song Folders enabled!");
			}
		}
		private void SongFolder_DoubleClick(object sender, EventArgs e)
		{
			this.BtnOK.PerformClick();
		}

        private void BtnCancel_Click(object sender, EventArgs e)
        {
            base.Close();
        }
	}
}
